﻿<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        Button1.Attributes.Add("onMouseOut", "this.src='images/chapstick_enviar_out.jpg';");
        Button1.Attributes.Add("onMouseOver", "this.src='images/chapstick_enviar_in.jpg';");
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        GridView1.Visible = true;
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Puntos de venta</title>
    <link href="css/estilos.css" rel="stylesheet" type="text/css" />
</head>
<body style="background-color:#66ccff; padding:0; margin:0">
    <form id="form1" runat="server">
    <div>
        <div style="margin-left:auto; margin-right:auto; text-align:center">
            <p style="font-family:Arial; font-size:16px; font-weight:bold">Buscar puntos de venta por barrio/localidad/ciudad:</p>
            <div style="width:347px; height:38px; margin-left:auto; margin-right:auto; background-image:url('images/campo_busqueda.jpg')">
                <asp:TextBox ID="TextBox1" runat="server" CssClass="loginboxSucursales"></asp:TextBox>
            </div>
            
            <br />
            <asp:ImageButton ID="Button1" runat="server" onclick="Button1_Click" ImageUrl="images/chapstick_enviar_out.jpg" />
        </div>
    
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:chapsticksucursalesConnectionString %>" 
            
            
            SelectCommand="SELECT * FROM [sucursales] WHERE ([localidad] LIKE '%' + @localidad + '%')">
            <SelectParameters>
                <asp:ControlParameter ControlID="TextBox1" Name="localidad" PropertyName="Text" 
                    Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br />
        <div style="margin-left:auto; margin-right:auto; font-family:Arial; font-size:12px; width:680px; text-align:center">
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True"
                AllowSorting="True" AutoGenerateColumns="False" EmptyDataText="No se han encontrado puntos de venta"
                DataSourceID="SqlDataSource1" 
                Visible="False" CellPadding="4" ForeColor="#333333" GridLines="None" 
                Width="680px">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:BoundField DataField="nombre" HeaderText="Nombre" 
                        SortExpression="nombre" />
                    <asp:BoundField DataField="direccion" HeaderText="Dirección" 
                        SortExpression="direccion" />
                    <asp:BoundField DataField="localidad" HeaderText="Localidad" 
                        SortExpression="localidad" />
                    <asp:BoundField DataField="provincia" HeaderText="Provincia" 
                        SortExpression="provincia" />
                </Columns>
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                <SortedDescendingHeaderStyle BackColor="#4870BE" />
            </asp:GridView>
        </div>
   
    </div>
    </form>
</body>
</html>
